package com.lzhsite.technology.designPattern.command.CalculatorDemo;

public class SubtractCommand implements ICommand
{
    private IOperation operation = null;

    private int operationNumber;

    public SubtractCommand(IOperation operation, int operationNumber)
    {
        this.operation = operation;
        this.operationNumber = operationNumber;
    }

    public void execute()
    {
        this.operation.subtract(operationNumber);
    }

    public void undo()
    {
        this.operation.add(operationNumber);
    }
}
